package com.ideyatech.errorhandling.entity;

import javax.persistence.*;

@Entity
@Table(name = "ISSUE")
public class Issue extends BaseEntity {

    public static enum Status {
	NEW, ASSIGNED
    }

    public static enum Type {
	ERROR, INQUIRY
    }

    @Column(name = "NAME")
    private String name;

    @Column(name = "DESCRIPTION")
    private String description;

    @Enumerated(EnumType.STRING)
    @Column(name = "STATUS")
    private Status status;
    
    @Enumerated(EnumType.STRING)
    @Column(name = "TYPE")
    private Type type;
    
    @ManyToOne
    @JoinColumn(name = "USER_ID")
    private User assignedUser;

    public void setAssignedUser(User assignedUser) {
        this.assignedUser = assignedUser;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public User getAssignedUser() {
        return assignedUser;
    }

    public void setName(String name) {
	this.name = name;
    }

    public String getName() {
	return name;
    }

    public void setDescription(String description) {
	this.description = description;
    }

    public String getDescription() {
	return description;
    }

    public void setStatus(Status status) {
	this.status = status;
    }

    public Status getStatus() {
	return status;
    }
}
